In [1]:
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from __future__ import division
from itertools import product
from spacetime.CA_Simulators.Greenberg_Hastings import *
In [ ]:
In [2]:
#Set model parameters
#square neighborhood radius
R = 3
#number of states / colors
K = 8
#excitation threshhold
T = 6
#initial conditions on 300x300 lattice
initial = random_state_v2((300,300), K, 2.0/9)
#initialize CA object with chosen parameters and initial condition
spirals = greenberg_hastings(initial, R, K, T)
#evolve the CA for 300 time steps
spirals.evolve(300)
In [3]:
spacetime_animation(spirals.get_spacetime(), colors = plt.cm.rainbow)
In [ ]:
In [5]:
#Set model parameters
#square neighborhood radius
R = 3
#number of states / colors
K = 8
#excitation threshhold
T = 6
#initial conditions on 300x300 lattice
initial = random_state_v2((300,300), K, 2.0/9)
#initialize CA object with chosen parameters and initial condition
spirals = greenberg_hastings(initial, R, K, T)
#evolve the CA for 300 time steps
spirals.animate(time = 300)
In [6]:
spacetime_animation(spirals.get_spacetime(), colors = plt.cm.rainbow)
In [ ]:
In [ ]:
Some fun travelling particles and collisions
In [7]:
R = 1
K = 4
T = 2
initial = random_state_v1((250, 250), 0.2)
example1 = greenberg_hastings(initial, R, K, T)
In [8]:
example1.evolve(300)
In [9]:
spacetime_animation(example1.get_spacetime(), colors = plt.cm.rainbow)
In [ ]:
In [ ]:
Start with very low driving, just see random sprinkling of excitations, no oscillations
Driving strength: 0.02
In [10]:
R = 1
K = 10
T = 2
initial = random_state_v1((200, 200), 0.5)
example2 = greenberg_hastings(initial, R, K, T)
In [11]:
example2.drive(200, 0.02)
In [12]:
spacetime_animation(example2.get_spacetime(), colors = plt.cm.rainbow)
In [ ]:
Keep same model parameters and initial conditions, now just bump up the driving rate and see global oscillations
Driving strength: 0.1
In [13]:
R = 1
K = 10
T = 2
initial = random_state_v1((200, 200), 0.5)
example3 = greenberg_hastings(initial, R, K, T)
In [14]:
example3.drive(200, 0.1)
In [15]:
spacetime_animation(example3.get_spacetime(), colors = plt.cm.rainbow, interval = 5)
In [ ]:
Increase driving further, collective oscillations become more pronounced
Driving strength: 0.5
In [16]:
R = 1
K = 10
T = 2
initial = random_state_v1((200, 200), 0.5)
example4 = greenberg_hastings(initial, R, K, T)
In [17]:
example4.drive(300, 0.5)
In [18]:
spacetime_animation(example4.get_spacetime(), colors = plt.cm.rainbow, interval = 5)
In [ ]:
In [ ]: